<template>
  <div id="app" class="id">
    <span v-if="is_top==1" class="top">置顶</span>
    <span :class="is_top==1 ? 'text text_indent' : 'text'" >{{info}}</span>
  </div>
</template>

<script>
import http from '@/utils/http'
import api from '@/api'
export default {
  props: ['id', 'is_top'],
  data () {
    return {
      info: ''
    }
  },
  mounted () {},
  created () {
    this.getdata()
  },
  methods: {
    getdata () {
      http.get(api.city_fulltext, {id: this.id}).then(res => {
        if (res.code == 200) {
          this.info = res.data.content
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.id{
  position: relative;
  color: #333333;
  font-size: 14px;
  .top{
    position: absolute;
    left: 0;
    top: 0;
    background-color: #ff4949;
    color: #FFFFFF;
    font-size: 10px;
    padding: 2px 5px;
    margin-right: 5px;
    border-radius: 3px;
  }
  .text{
    font-size: 14px;
    display: inline-block;
    word-break: break-all;
  }
  .text_indent{
    text-indent: 2.5em;
  }
}
</style>
